package com.xsh.opensltest;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MixerActivity extends AppCompatActivity {

    private LinearLayout MixerList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mixer);
        MixerList = findViewById(R.id.MixerList);
        findViewById(R.id.MixerChannelAddButton).setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View view)
            {

                createNewMixerChannel();
            }
        });
    }
    private void createNewMixerChannel()
    {
        LinearLayout MixerChannel = new LinearLayout(MixerActivity.this);
        MixerChannel.setOrientation(LinearLayout.VERTICAL);
        TextView MixerIndex = new TextView(MixerActivity.this);
        MixerIndex.setText(0);
        TextView MixerChannelLabel = new TextView(MixerActivity.this);
        MixerChannelLabel.setText("乐器");
        MixerChannel.addView(MixerIndex);
        MixerChannel.addView(MixerChannelLabel);
        MixerList.addView(MixerChannel);
    }
}